package com.wyx.suanfa;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class averageOfLevels {
    public static void main(String[] args) {
    }
}

/*
* class Solution {
    public List<Double> averageOfLevels(TreeNode root) {
        List<Double> list = new ArrayList<>();
        Queue<TreeNode> que = new LinkedList<>();

        que.offer(root);
        while(!que.isEmpty()){
            int len = que.size();
            Double sum = 0.0;
            for(int i = 0;i < len; i++){
                TreeNode temp = que.poll();
                if(temp.left != null){
                    que.offer(temp.left);
                }
                 if(temp.right != null){
                    que.offer(temp.right);
                }
                sum +=temp.val;
            }
            list.add(sum/len);
        }
        return list;


    }
}*/
